package com.petshop.action;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.common.constant.BalzLogger;
import com.common.constant.URLConstant;
import com.petshop.model.Product;
import com.petshop.service.ProductService;
import com.petshop.service.ProductServiceImpl;

public class RedirectPage{
	
	BalzLogger logger = new BalzLogger();
	
	public void forward(HttpServletRequest request, HttpServletResponse response, String page) throws ServletException, IOException{
		
		logger.debug("Redirect to > "+page);
	
		ProductAction  action = new ProductAction();
		action.newProductLoad(request, response);
		action.rateProductLoad(request, response);
		action.allProductLoad(request, response);
		
		// Load Shop Detail
		ShopAction shopAction = new ShopAction();
		shopAction.shopDetailLoad(request, response);
		
		RequestDispatcher view = request.getRequestDispatcher(page);
		view.include(request, response);
		
	}
	
}
